package be.jhd.appserver;

import be.jhd.appserver.weblogic.command.CommandBuilder;
import be.jhd.appserver.weblogic.command.WeblogicConfig;

public abstract class AbstractCommand implements Command{
	
	private final CommandBuilder builder = new CommandBuilder();
	
	protected void add(String key){
		builder.add(key);
	}

	protected void add(String key, String value){
		builder.add(key, value);
	}
	
	public final String[] getParameters(WeblogicConfig config){
		addParameters(config);
		return builder.build();
	}
	
	public final String toString(){
		return builder.toString();
	}
	
	protected abstract void addParameters(WeblogicConfig config);
	
}
